package com.vtc.session1;

import com.vtc.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class LoginActivity extends Activity implements OnClickListener {

	private EditText editUser;
	private EditText editPass;
	private Button btnLogin;
	@Override
	protected void onCreate(Bundle savedInstanceState) {		
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.login_acitivity);
		
		this.editUser= (EditText) findViewById(R.id.editUserName);
		this.editPass= (EditText) findViewById(R.id.editPassword);
		this.btnLogin= (Button)   findViewById(R.id.btnLogin);
		
		
		// dang ky su kien click vao nut button
		this.btnLogin.setOnClickListener(this);
	}
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
	    if(v==btnLogin){ // neu click vao nut login 
	    	String username = editUser.getText().toString();
	    	String password = editPass.getText().toString();
	    	
	    	Toast.makeText(this, username+">>"+password, Toast.LENGTH_LONG).show();
	    }
	}
}
